<!DOCTYPE html>
<html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
      <title>会员中心</title>
      {include file="public/link" /}
      <style type="text/css">
        .layui-table-body{
            overflow: hidden;
        }
        html{
          background: #efefef;
        }
        body{
          background: #efefef;
        }
        .height2{
          background: #efefef;
        }
      </style>
  </head>
  <body>
 
    <div class="maincont">
     {include file="public/user_head" /}

    
<div class="order_tab">
    <div class="layui-tab">
      <ul class="layui-tab-title">
        <li class="layui-this">所有</li>
        <li>未使用</li>
        <li>已使用</li>
        <li>未付款</li>
     
      </ul>
      <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <?php
                if(!$order){
                  echo "<p class='nolist'>没有订单</p>";
                }
            ?>



            {volist name="order" id="vo"}
                    <li>
                      <form class="layui-form" action="">
                          <h2>{$vo.shoptitle}<i class="i{$vo.state}">{$vo.state_type}</i></h2>
                          <p><span>商品类型：{$vo.pay_type}</span><i>共{$vo.num}件商品，合计：{$vo.pay_money}</i></p>
                          <time>下单时间：{$vo.ordertime}</time>
                          <div class="clearfix"></div>
                          {if condition="$vo.state != 'p0'"}
                          <div class="key"><!--卡密：{$vo.key}--><a class="layui-btn layui-btn-sm"  href="{:url('user/show')}?id={$vo.id}" style="float: right;">查看</a></div>
                          <!--
                          <div style="margin-top: 10px;"><img src='{$vo.bar}' style='width:100%'></div>

                          <div style="text-align: center;"><img src="{$vo.qr}"></div>-->
                          {/if}
                          {if condition="($vo.state == 'p0') and ($vo.type != '3')"}
                          <div class="key">
                              <a href="{:url('user/delorder')}?id={$vo.id}" class="layui-btn layui-btn-sm layui-btn-danger" lay-filter="pay" style="float: right;margin-left: 2px;">删除</a>
                              <button class="layui-btn layui-btn-sm " lay-submit="" lay-filter="pay">去付款</button>
                          </div>
                          {/if}
                          <input type="hidden" value="{$vo.shoptitle}" name="title">
                          <input type="hidden" value="{$vo.key}" name="key">
                          <input type="hidden" value="{$vo.id}" name="id">
                          <input type="hidden" value="{$vo.state_type}" name="state_type">
                          <div class="clearfix"></div>
                      </form>
                    </li>
                    {/volist}






        </div>
        <div class="layui-tab-item">
            <?php
                if(!$tab_order_1){
                  echo "<p class='nolist'>没有订单</p>";
                }
            ?>
                {volist name="tab_order_1" id="vo"}
                    <li>
                      <form class="layui-form" action="">
                          <h2>{$vo.shoptitle}<i class="i{$vo.state}">{$vo.state_type}</i></h2>
                          <p><span>商品类型：{$vo.pay_type}</span><i>共{$vo.num}件商品，合计：{$vo.pay_money}</i></p>
                          <time>下单时间：{$vo.ordertime}</time>
                          <div class="clearfix"></div>
                          {if condition="$vo.state != 'p0'"}
                          <div class="key"><!--卡密：{$vo.key}--><a class="layui-btn layui-btn-sm"  href="{:url('user/show')}?id={$vo.id}" style="float: right;">查看</a></div>
                          <!--
                          <div style="margin-top: 10px;"><img src='{$vo.bar}' style='width:100%'></div>

                          <div style="text-align: center;"><img src="{$vo.qr}"></div>-->
                          {/if}
                          {if condition="($vo.state == 'p0') and ($vo.type != '3')"}
                          <div class="key">
                              <a href="{:url('user/delorder')}?id={$vo.id}" class="layui-btn layui-btn-sm layui-btn-danger" lay-filter="pay" style="float: right;margin-left: 2px;">删除</a>
                              <button class="layui-btn layui-btn-sm " lay-submit="" lay-filter="pay">去付款</button>
                          </div>
                          {/if}
                          <input type="hidden" value="{$vo.shoptitle}" name="title">
                          <input type="hidden" value="{$vo.key}" name="key">
                          <input type="hidden" value="{$vo.id}" name="id">
                          <input type="hidden" value="{$vo.state_type}" name="state_type">
                          <div class="clearfix"></div>
                      </form>
                    </li>
                    {/volist}
        </div>
        <div class="layui-tab-item">
            <?php
                if(!$tab_order_0){
                  echo "<p class='nolist'>没有订单</p>";
                }
            ?>
                {volist name="tab_order_0" id="vo"}
                    <li>
                      <form class="layui-form" action="">
                          <h2>{$vo.shoptitle}<i class="i{$vo.state}">{$vo.state_type}</i></h2>
                          <p><span>商品类型：{$vo.pay_type}</span><i>共{$vo.num}件商品，合计：{$vo.pay_money}</i></p>
                          <time>下单时间：{$vo.ordertime}</time>
                          <div class="clearfix"></div>
                          {if condition="$vo.state != 'p0'"}
                          <div class="key"><!--卡密：{$vo.key}--><a class="layui-btn layui-btn-sm"  href="{:url('user/show')}?id={$vo.id}" style="float: right;">查看</a></div>
                          <!--
                          <div style="margin-top: 10px;"><img src='{$vo.bar}' style='width:100%'></div>

                          <div style="text-align: center;"><img src="{$vo.qr}"></div>-->
                          {/if}
                          {if condition="($vo.state == 'p0') and ($vo.type != '3')"}
                          <div class="key">
                              <a href="{:url('user/delorder')}?id={$vo.id}" class="layui-btn layui-btn-sm layui-btn-danger" lay-filter="pay" style="float: right;margin-left: 2px;">删除</a>
                              <button class="layui-btn layui-btn-sm " lay-submit="" lay-filter="pay">去付款</button>
                          </div>
                          {/if}
                          <input type="hidden" value="{$vo.shoptitle}" name="title">
                          <input type="hidden" value="{$vo.key}" name="key">
                          <input type="hidden" value="{$vo.id}" name="id">
                          <input type="hidden" value="{$vo.state_type}" name="state_type">
                          <div class="clearfix"></div>
                      </form>
                    </li>
                    {/volist}
        </div>
        <div class="layui-tab-item">
            <?php
                if(!$tab_order_p0){
                  echo "<p class='nolist'>没有订单</p>";
                }
            ?>
                {volist name="tab_order_p0" id="vo"}
                    <li>
                      <form class="layui-form" action="">
                          <h2>{$vo.shoptitle}<i class="i{$vo.state}">{$vo.state_type}</i></h2>
                          <p><span>商品类型：{$vo.pay_type}</span><i>共{$vo.num}件商品，合计：{$vo.pay_money}</i></p>
                          <time>下单时间：{$vo.ordertime}</time>
                          <div class="clearfix"></div>
                          {if condition="$vo.state != 'p0'"}
                          <div class="key"><!--卡密：{$vo.key}--><a class="layui-btn layui-btn-sm"  href="{:url('user/show')}?id={$vo.id}" style="float: right;">查看</a></div>
                          <!--
                          <div style="margin-top: 10px;"><img src='{$vo.bar}' style='width:100%'></div>

                          <div style="text-align: center;"><img src="{$vo.qr}"></div>-->
                          {/if}
                          {if condition="($vo.state == 'p0') and ($vo.type != '3')"}
                          <div class="key">
                              <a href="{:url('user/delorder')}?id={$vo.id}" class="layui-btn layui-btn-sm layui-btn-danger" lay-filter="pay" style="float: right;margin-left: 2px;">删除</a>
                              <button class="layui-btn layui-btn-sm " lay-submit="" lay-filter="pay">去付款</button>
                          </div>
                          {/if}
                          <input type="hidden" value="{$vo.shoptitle}" name="title">
                          <input type="hidden" value="{$vo.key}" name="key">
                          <input type="hidden" value="{$vo.id}" name="id">
                          <input type="hidden" value="{$vo.state_type}" name="state_type">
                          <div class="clearfix"></div>
                      </form>
                    </li>
                    {/volist}
        </div>

      </div>
    </div>
  </div>


      
     <div class="lrSub">
       <a href="{:url('user/index')}">返回会员中心</a>
     </div>
     
     <div class="height1"></div>
     {include file="public/footnav" /}
    </div><!--maincont-->
  
    <script src="{$Assets}layui/layui.js?t=1515376178709"></script>

<script>
layui.use(['form', 'layedit', 'laydate','layer','element'], function(){ 
  var $ = layui.jquery, layer = layui.layer; 
    var form = layui.form
  ,layer = layui.layer
  ,element = layui.element
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  

  //监听提交
  form.on('submit(pay)', function(data){
                   
                    $.ajax({
                        type:"POST",
                        url: "{:url('user/orderpay')}",
                        data:{id:data.field.id},
                        dataType:"text",

                        success:function(ret_datas){
                          if(ret_datas==1){
                            window.location.href='/pay/wxpay/example/jsapi_shop.php';
                          }else if(ret_datas==0||ret_datas==10){
                            window.location.href='/index.php/index/login/index';
                          }else if(ret_datas==101){
                            layer.msg('此订单异常');
                          }
                        }
                    });
    return false;
  });



  
  $('.vle_order_list .layui-btn').on('click', function(){
    var othis = $(this), method = othis.data('method');
    active[method] ? active[method].call(this, othis) : '';
  });
  
});
</script>




    {include file="public/footer" /}
  </body>
  
</html>